﻿using Avalonia;
using Avalonia.Media;
using KinonekoSoftware.Extensions.Ioc;
using KinonekoSoftware.Foundation.UI;
using NLog;

namespace KinonekoSoftware.Studio.Linux
{
    class Program
    {
        // Initialization code. Don't use any Avalonia, third-party APIs or any
        // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
        // yet and stuff might break.
        [STAThread]
        public static void Main(string[] args)
        {
            try
            {
                BuildAvaloniaApp()
                   .StartWithClassicDesktopLifetime(args);
            }
            catch(Exception ex)
            {
                Xplat.Error(ex.Message);
            }
        }
        //
        // // Avalonia configuration, don't remove; also used by visual designer.
        // public static AppBuilder BuildAvaloniaApp()
        //     => AppBuilder.Configure<App>()
        //                  .UsePlatformDetect()
        //                  .WithInterFont()
        //                  .LogToTrace()
        //                  .With(new FontManagerOptions
        //                   {
        //                       DefaultFamilyName = "avares://AvaloniaTest/Assets/Fonts/微软雅黑.ttf#Microsoft YaHei",
        //                       FontFallbacks = new[]
        //                       {
        //                           new FontFallback
        //                           {
        //                               FontFamily = new FontFamily("avares://AvaloniaTest/Assets/Fonts/微软雅黑.ttf#Microsoft YaHei")
        //                           }
        //                       }
        //                   });
        
        
        // Avalonia configuration, don't remove; also used by visual designer.
        public static AppBuilder BuildAvaloniaApp()
            => AppBuilder.Configure<App>()
                         .UsePlatformDetect()
                         .WithInterFont()
                         .LogToTrace();
    }
}